package de.baumann.browser.activitys;

import android.content.Context;
import android.content.Intent;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import java.util.ArrayList;
import java.util.List;

import de.baumann.browser.R;
import de.baumann.browser.adapter.PagerAdapter;
import de.baumann.browser.base.BaseOdinActivity;
import de.baumann.browser.base.BasePresenter;
import de.baumann.browser.fragments.BookmarkFragment;
import de.baumann.browser.fragments.HistoryFragment;
import de.baumann.browser.iview.IBaseView;

/**
 * @author：
 * @date：2018/9/26
 * @discription: 书签和历史记录
 **/
public class BookMarkAddHistoryActivity extends BaseOdinActivity {

    public static void startBookMarkAddHistoryActivity(Context context){
        context.startActivity(new Intent(context,BookMarkAddHistoryActivity.class));
    }
    private ViewPager mViewpager;
    private TabLayout mTabMarkAndHistory;

    @Override
    protected int getLayout() {
        return R.layout.activity_book_mark_add_history;
    }


    @Override
    public String getTitleText() {
        return getString(R.string.bookmark_and_history);
    }

    @Override
    protected void initView() {
        initToolbar(findViewById(R.id.commToolBar),null);
        mTabMarkAndHistory = findViewById(R.id.tabMarkAndHistory);
        mViewpager = findViewById(R.id.viewpager);
        List<Fragment> fragments = new ArrayList<>();
        fragments.add(new BookmarkFragment());
        fragments.add(new HistoryFragment());
        PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), fragments, new String[]{getString(R.string.album_title_bookmarks),
                getString(R.string.album_title_history)});
        mViewpager.setAdapter(adapter);
        mTabMarkAndHistory.setupWithViewPager(mViewpager);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected BasePresenter createPresenter() {
        return null;
    }

    @Override
    protected IBaseView createView() {
        return null;
    }

    @Override
    public boolean showBindEth() {
        return false;
    }
}
